<!-- questions.html -->
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
	xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
<head th:include="inc/examHeader::header">
</head>
<script type="text/javascript" src="/exam/js/questions.js" ></script>
	<body>
		<!--返回-->
		<div class="back" onclick="location='/index'"><img src="../images/back.png" /></div>
		<div th:include="header :: header"></div>
		<div class="header-title">
			<span>试题管理</span> 
		</div>
		<div class="spare-a">
			<div class="questions-ar">
				<div class="spare-ara">
					<div class="spare-ara-a clearfix">
						<div class="spare-ara-al">
							<div class="spare-ara-all"><input type="text" placeholder="请输入关键字" id="search"/></div>
							<div class="spare-ara-alr" onClick="js_method()"></div>
						</div>
						<div class="spare-ara-ar">
							<a href="/questions/questions-add" class="spare-tj" shiro:hasPermission="sys:testquestions:add" >添 加</a>
							<a href="#" class="spare-qx" id="questions-selectAll" sel="Y" style="display:none" hid='Y' shiro:hasPermission="sys:testquestions:del">全 选</a>
							<a href="#" class="spare-edit" id="questions-edit" style="display:none" hid='Y' shiro:hasPermission="sys:testquestions:edit">编 辑</a>
							<a href="#" class="spare-del" id="questions-del" style="display:none" hid='Y' shiro:hasPermission="sys:testquestions:del">删 除</a>
						</div>
					</div>
					<div class="srcoll-documentation" id="srcoll-documentation" shiro:hasPermission="sys:testquestions:view">
					<div class="documentation paper">
						<ul class="lists" id="lists">
							<!-- <a href="#" th:each="question,index:${questions}">
							<li>
								<div hidden="hidden">
									<input type="checkbox"   name="ids" th:value="${question.id}"/>
				          			<input  th:id="${question.id}" th:value="${index.count}"/>
				          			<input  th:id="${'status-'+question.id}" th:value="${question.status}"/>
								</div>
								<div class="paper-a" th:text="${'题目:'+question.content}"></div>
								<div class="paper-b"><span style="padding-left:0px" th:text="${'题型:'+question.code}"></span><span  th:text="${'创建人:'+question.createUser}"></span></div>
								<div class="paper-c" th:text="${'创建日期:'+question.createDate}"></div>
								<div class="documentation-check"></div>
							</li>
							</a> -->
						</ul>
					</div>
					</div>
				</div>
			</div>
		</div>
		
		
		<script th:inline="javascript">  
/*<![CDATA[*/
           $(function() {
	 		loadDataPage("/questions/findByPage", "srcoll-documentation",
					"lists", 12, "search"); 
		});
		//构建数据列表
 		function dataKk(data, me) {
			var result = '';
			var arrLen = data.length;
			if (arrLen > 0) {
				for (var i = 0; i < arrLen; i++) {
					result += '<a href="#">' + '<li id="'+data[i].id+'">'
							+'<div hidden="hidden"><input type="checkbox"   name="ids" value="'+data[i].status+'"/></div>'
							+ '<div class="paper-a">题目：' + data[i].content+ '</div>'
							+ '<div class="paper-b">题型：' + data[i].code + '<span>创建人：' + data[i].createUser+ '</span>'+ '</div>'
							+ '<div class="paper-c">创建日期：' + data[i].createDate+ '</div>'
							+ '<div class="documentation-check"></div>'
							+ '</li>' + '</a>'
				}
			} else {
				me.lock();
				me.noData();
			}
			return result; 
		} 
		 
 		function js_method() {
 			$(".dropload-down").remove();
 			$('#lists').html("");
 			loadDataPage("/questions/findByPage", "srcoll-documentation", "lists", 12,"search");	
 		}
 
           /*]]>*/  
</script>
		
		
		
		
		
		
		
	</body>
</html>
